package org.kfive.nova.design.structture.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * TODO
 *
 * @author zhanwu.lzw
 * @version V1.0
 * @date 2017年12月09日 16:30
 */
public class DynamicProxyHandler implements InvocationHandler {

    private Object realObject;

    public DynamicProxyHandler(Object realObject) {
        this.realObject = realObject;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("proxy do");

        return method.invoke(realObject,args);
    }

    public static void main(String[] args) {

    }
}
